var getOverrides = function(theme){
    var themes = {
        "white": {
            //url: "day.css",
            up: "#03c087",
            down: "#ef5555",
            bg: "#ffffff",
            grid: "#f7f8fa",
            cross: "#23283D",
            border: "#9194a4",
            text: "#9194a4",
            areatop: "rgba(71, 78, 112, 0.1)",
            areadown: "rgba(71, 78, 112, 0.02)",
            line: "#737375"
        },
        "black": {
            up: "#f74f3f",
            down: "#12c78c",
            bg: "#101420",
            grid: "rgba(175, 184, 219, .1)",
            cross: "rgba(145, 148, 163, .7)",
            border: "#4e5b85",
            text: "#61688A",
            areatop: "rgba(122, 152, 247, .1)",
            areadown: "rgba(122, 152, 247, .02)",
            line: "#737375"
        },
    };
    var t = themes[theme];
    return {
        "volumePaneSize": "medium",    //  副指标高低：large, medium, small, tiny
        "scalesProperties.lineColor": 'rgba(175, 184, 219, .5)',  //  视图划分横线  
        "scalesProperties.textColor": 'rgba(175, 184, 219, .4)',  //  视图字体颜色
        "paneProperties.background": t.bg,   //  视图背景颜色
        "paneProperties.vertGridProperties.color": t.grid,  //  y轴线条颜色
        "paneProperties.horzGridProperties.color": t.grid,  //  x轴线条颜色
        "paneProperties.crossHairProperties.color": t.cross, //  十字架颜色
        "paneProperties.legendProperties.showLegend": true,  //  显示商品说明，指标指数块。
        "paneProperties.legendProperties.showStudyTitles": true, //  指标标题：MA(**)
        "paneProperties.legendProperties.showSeriesTitle":false,   //  显示商品标题
        "paneProperties.legendProperties.showSeriesOHLC": true,   //  显示：最高 最低 今开
        "mainSeriesProperties.candleStyle.upColor":t.up ,   //  上涨 K线颜色
        "move_logo_to_main_pane":true, 
        "mainSeriesProperties.candleStyle.downColor": t.down,  //  下跌 K线颜色
        'mainSeriesProperties.candleStyle.wickUpColor':t.up,
        'mainSeriesProperties.candleStyle.wickDownColor':t.down,
        "mainSeriesProperties.candleStyle.borderColor": t.up,
        "mainSeriesProperties.candleStyle.borderUpColor":  t.up,   
        "mainSeriesProperties.candleStyle.borderDownColor":  t.down,   
        "paneProperties.vertGridProperties.style": 2,
        "mainSeriesProperties.areaStyle.color1": t.areatop,
        "mainSeriesProperties.areaStyle.color2": t.areadown,
        "mainSeriesProperties.areaStyle.linecolor": t.border,
        "mainSeriesProperties.areaStyle.linewidth": 1,
        "mainSeriesProperties.areaStyle.priceSource": "close"
    }
}
var initLimit = function(resolution, rangeStartDate, rangeEndDate){ // 返回柱子数量
    let limit = 0;
    switch(resolution){
      // 1 天
        case '1D' : limit = 350; break;  
      // 1 周 
        case '1W' : limit = 200; break;
      // 1 月
        case '1M' : limit = 100; break;
      // 1 分 与 5 分 与 1小时
        default : limit = 350; break;
    }
    return limit;
}

var disabArr=[
    "header_symbol_search",
    "header_saveload",
    "header_screenshot",
    "header_chart_type",
    "header_compare",
    "header_undo_redo",
    "timeframes_toolbar",
    "volume_force_overlay",
    "header_resolutions",
    "left_toolbar",
    "header_widget_dom_node"
]

export  {getOverrides,initLimit,disabArr}